<?php

namespace Org;


/**
 * Class Pinyin
 * @package Tp
 */
class Pinyin
{
    /**
     * @var
     * @author: TopThink
     * @date: 2020/3/23-15:37
     */
    static protected $instance;

    /**
     * @var string
     * @author: TopThink
     * @date: 2020/3/23-15:37
     */
    static protected $trust = "";


    /**
     * @param int $type
     * @return \Overtrue\Pinyin\Pinyin
     * @author: TopThink
     * @date: 2020/3/23
     * @name: instance
     * @describe:
     */
    public static function instance($type = 1)
    {
        // 小内存型
        if ($type == 1) {
            self::$trust = "";
        } else {
            if ($type == 2) {
                // 内存型
                self::$trust = "Overtrue\Pinyin\MemoryFileDictLoader";
            } else {
                if ($type == 3) {
                    // I/O型
                    self::$trust = "Overtrue\Pinyin\GeneratorFileDictLoader";
                }
            }
        }

        return new \Overtrue\Pinyin\Pinyin(self::$trust);
    }

}